<div id='regionAjax' style='display:none;border-bottom:1px solid silver;width:100%;min-height:100px;height:auto;margin-bottom: 20px'></div>
<?php 
$auth = Zend_Auth::getInstance();
$admin_id = $auth->getIdentity()->id; 
if($admin_id == 1){
?>

<h3 id='title'> List user </h3>
<div id="table_area">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
	<tbody>
		<tr>
			<td align="left"><input type="button" title="" class="btn btn_red" value="new" id='new' name='new' onclick="loadRegionAjax('/user/index/load-region-ajax','do=add')"></td>
		</tr>
	</tbody>
</table>			
<?php } ?>

<?php 
$list = $this->list_user;
if($list){
?>
<form id='adminForm' name='adminForm' method="post">
<table width="100%" cellspacing="0" cellpadding="4" border="0" class="tbl">
	<tbody>
		<tr align="center" class="tr2">
	    		<td width="40" align="center"> No </td>
	    		<td align="left"> User name </td>
				<td align="left"> Full name </td>
				<td align="left"> Email </td>
				<td align="left"> Phone </td>
				<?php if($admin_id == 1){ ?>
				<td></td>
				<td width="40" align="center"></td>
				<?php } ?>
			</tr>
			<?php 			
			foreach ($list as $key => $value) {
				echo ($key % 2 == 0)?("<tr class='tr4' id = '".$value['id']."'>"):("<tr class='tr3' id = '".$value['id']."'>");
				echo "<td align='center'>". ($key + 1) ."</td>";
				echo "<td align='left'>". $value['user_name'] ."</td>";
				echo "<td align='left'>". $value['full_name'] ."</td>";
				echo "<td align='left'>". $value['email'] ."</td>";
				echo "<td align='left'>". $value['phone'] ."</td>";
				if($admin_id == 1){ 
					$uid = $value['id'];
					$url = "/user/delete";
					echo "<td><input type='button' title='edit' class='btn_ico edit' value='' onclick='editAdmin(".$value['id'].")'></td>";
					echo "<td align='center'><span href='#' onclick='sub_delete("."$url".")' > delete </spanz></td>";
				}
				echo "</tr>";
			}
			?>
	</tbody>
</table>
</form>
<?php 
}
?>
</div>